Repository navigation
feat(vba): type VBA call receivers through globals, factories and chains - #348
Merged
Merged
Conversation
Ports the logic of upstream's VB.NET receiver typing to VBA: - Public variables of standard modules used from other files (only in files with Option Explicit, never a shadowed name) - Set x = Factory() where Factory declares its return type - Me.Field.Member and typed module fields - chain hops through a Property Get / Function return type or a public field (a.Hijo.IDCalc -> Otra.IDCalc), including With a.Hijo and With .Hijo inside a typed With - with a known receiver type only that class's member is linked; zero or several candidates, primitives, Object or arrays fail closed For Each has no element type in VBA and is not typed. Closes #345
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #345. Ports the logic of upstream's VB.NET receiver typing to the VBA extractor and resolver.
New receiver shapes
Publicvariable of a standard module used from other files (gObj.Member,With gObj). Only in files withOption Explicit, and never for a name a parameter or local shadows.Set x = Factory()where the factory declares its return type, in another file.Me.Field.Memberand typed module fields.Property Get/Functionreturn type or a public field:a.Hijo.IDCalc→Otra.IDCalc,With a.Hijo,With .Hijoinside a typedWith.Type.Memberis linked. Zero or several candidates, a primitive,Object, a qualified type or an array mean no edge.For Eachis not typed (VBA collections have no element type).As EXPEDIENTEvs classExpediente) also resolves.Evidence
tscis clean.calls.m_ObjEntorno.X), 27Setwrites, chain hops,Me.Field/Me.Propreads, and 51 reads on receivers declared in another case (Dim m_Expediente As EXPEDIENTE→Expediente.RistraResponsables). Samples were checked by grep.Known limits
sync: a stub dropped because its type was unknown is not re-created when the declaration appears later in another file (same as fix(vba): Property Get reads through member access produce no caller edges #334). A full reindex handles it.metadata.returnTypekeeps only the outer name of a qualified type (Scripting.Dictionary→Scripting), which fails closed.